<?php

use Illuminate\Http\Request;
use Illuminate\Support\Facades\Route;

/*
|--------------------------------------------------------------------------
| API Routes
|--------------------------------------------------------------------------
|
| Here is where you can register API routes for your application. These
| routes are loaded by the RouteServiceProvider and all of them will
| be assigned to the "api" middleware group. Make something great!
|
*/
/**
 *  --------------------------------登录接口
 */
Route::prefix('login')->group(function () {
    Route::post('send', [\App\Http\Controllers\Auth\SmsController::class, 'sendH5SmsCode']); //发送验证码
    Route::post('login', [\App\Http\Controllers\Auth\H5UserController::class, 'loginBySms']); //登录
    Route::post('refreshToken', [\App\Http\Controllers\Auth\H5UserController::class, 'refresh']); //刷新token
});
/**
 *  --------------------------------优惠券接口（包括h5）
 */
Route::prefix('coupon')->group(function () {
    Route::post('create', [\App\Http\Controllers\H5\CouponController::class, 'createCoupon']); //添加优惠券
    Route::post('listRecord', [\App\Http\Controllers\H5\CouponController::class, 'recordList']); // 创建记录列表
    Route::post('list', [\App\Http\Controllers\H5\CouponController::class, 'couponList']); //优惠券列表
    Route::post('consume', [\App\Http\Controllers\H5\CouponController::class, 'couponConsume']); //优惠券统计
    Route::get('import', [\App\Http\Controllers\H5\CouponController::class, 'couponImport']); //优惠券导出
    Route::middleware('auth:h5user')->post('Info', [\App\Http\Controllers\H5\CouponController::class, 'couponInfo']); //h5获取优惠券信息
});
/**
 *  --------------------------------h5商品接口（包括h5）
 */
Route::prefix('h5Goods')->group(function () {
    Route::post('upload', [\App\Http\Controllers\H5\H5GoodsController::class, 'uploadImg']);                          //上传图片
    Route::post('detail', [\App\Http\Controllers\H5\H5GoodsController::class, 'h5GoodsDetail']);  // 商品详情（管理端）
    Route::post('editProfit', [\App\Http\Controllers\H5\H5GoodsController::class, 'profitEdit']);  // 利润编辑
    Route::post('goodsList', [\App\Http\Controllers\H5\H5GoodsController::class, 'h5GoodsSupplierList']);  // 商品列表
    Route::post('edit', [\App\Http\Controllers\H5\H5GoodsController::class, 'h5GoodsEdit']); // 商品编辑
    Route::post('name', [\App\Http\Controllers\H5\H5GoodsController::class, 'goodsName']); // 获取商品名称
    Route::post('h5GoodsManage', [\App\Http\Controllers\H5\H5GoodsController::class, 'h5GoodsManage']); // 一键h5展示
    Route::post('list', [\App\Http\Controllers\H5\H5GoodsController::class, 'h5GoodsList']); // h5端商品列表
    Route::post('listDetail', [\App\Http\Controllers\H5\H5GoodsController::class, 'h5GoodsListDetail']); //H5端商品详情（前端）
    Route::middleware('auth:h5user')->post('thinking', [\App\Http\Controllers\H5\H5GoodsController::class, 'h5GoodsThink']); //h5商品名称联想
});
/**
 *   支付宝创创建支付
 */
Route::middleware('auth:h5user')->post('createPay', [\App\Http\Controllers\Alipay\AlipayController::class, 'createH5CouponPay']);
Route::post('alipayNotify', [\App\Http\Controllers\Alipay\AlipayController::class, 'alipayCouponNotify']);// 支付宝异步回调地址
/**
 *  --------------------------------h5订单接口（包括h5）
 */
Route::prefix('h5Order')->group(function () {
    Route::post('list', [\App\Http\Controllers\H5\H5OrderController::class, 'merchantH5Order']);   //　h5订单列表 商户/供应商 端
    Route::middleware('auth:h5user')->post('orderList', [\App\Http\Controllers\H5\H5OrderController::class, 'h5Order']); //h5订单列表 h5 端
});

